<?php Schema::init(); ?>
<div class="schema_wrapper">
	<?php if ($error > -1) { ?>
		<div class="schema_message">
		<?php if (!$error) {
			echo 'File inserted sucsesfuly';
		} else {
			echo 'Error inserting file';
		} ?>
		</div>
	<?php } ?>

	<div class="schema_header">
		Inserting new file
	</div>
	<form action="<?php echo CURRENT_URL; ?>" method="post" enctype="multipart/form-data">
		<div class="schema_tabs">
			<a href="#0" id="schema_tab_0" class="tab_on" onclick="Core.Schema.openTab(0)">General</a>
		</div>
		<div class="schema_blocks">
			<div class="schema_block" id="schema_block_0">
				<table border="0" width="100%" cellspacing="10" cellpadding="0">
					<colgroup>
						<col class="schema_column_headers" />
						<col class="schema_column_fields" />
					</colgroup>
					<tr>
						<td class="schema_cell_header">File</td>
						<td class="schema_cell_field"><input type="file" id="uploaded_file" name="uploaded_file" class="schema_textfield" /></td>
					</tr>
					<tr>
						<td class="schema_cell_header">Status</td>
						<td class="schema_cell_field">
							<select id="file_status_id" name="file_status_id" class="schema_select">
								<option value="1">Opened</option>
								<option value="2">Closed</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="schema_cell_header">Parent category</td>
						<td class="schema_cell_field">
							<select id="file_cat_id" name="file_cat_id" class="schema_select">
								<?php Category::drawTreeSelect(2, $cat_id); ?>
							</select>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="schema_buttons"><input type="submit" value="Insert" class="schema_submit" /></div>
	</form>
</div>